{extend name="../../admin/view/public/admin"}

{block name='content'}


<style>
    .multi-item {
        margin-bottom: 18px;
    }
</style>


<div class="page-header">
    当前位置：<span class="text-primary">{if !empty($item)}编辑{else}新建{/if}表单
    	<small>{if !empty($item)}(名称: {$item['company']}){/if}</small>
    </span>
</div>

<div class="page-content">

    <form action="" method="post" class="form-validate form-horizontal ">
        <input type="hidden" name="id" value="{$item['id']}"/>
        <input type="hidden" name="type" value="{$type}"/>

        <div class="form-group-title">表单基本信息</div>

        <div class="form-group">
            <label class="col-lg control-label must">文本</label>
            <div class="col-sm-9 col-xs-12">
                <div class="form-control-static">这是静态的不可编辑的内容</div>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label must">排序</label>
            <div class="col-sm-9 col-xs-12">
                <input type="text" name="displayorder" class="form-control" value="{:intval($item['displayorder'])}" data-rule-required='true'/>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label must">表单名称</label>
            <div class="col-sm-9 col-xs-12">
                <input type="text" name="name" class="form-control" value="{$item['name']}" data-rule-required='true'/>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label must">简单描述</label>
            <div class="col-sm-9 col-xs-12">
                <textarea name="description" rows="4" placeholder="请输入简单描述" class="form-control" data-rule-required="true">{$item['description']}</textarea>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label">显示状态</label>
            <div class="col-sm-9 col-xs-12">
                <label class="radio-inline">
                    <input type="radio" name="enabled" value="1" {if $item['enabled']==1}checked="checked"{/if}> 显示
                </label>
                <label class="radio-inline">
                    <input type="radio" name="enabled" value="0" {if $item['enabled']==0 || empty($item)}checked="checked"{/if}> 隐藏
                </label>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label">属性</label>

            <div class="col-sm-9 col-xs-12">
                <label for="isrecommand" class="checkbox-inline">
                    <input type="checkbox" name="isrecommand" value="1" id="isrecommand" {if $item['isrecommand'] == 1}checked="true"{/if}/> 推荐
                </label>

                <label for="isnew" class="checkbox-inline">
                    <input type="checkbox" name="isnew" value="1" id="isnew" {if $item['isnew'] == 1}checked="true"{/if}/> 最新
                </label>

                <label for="ishot" class="checkbox-inline">
                    <input type="checkbox" name="ishot" value="1" id="ishot" {if $item['ishot'] == 1}checked="true"{/if}/> 最热
                </label>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label">类型</label>
            <div class="col-sm-9 col-xs-12">
                <select class="form-control" name="type">
                    <option value="0" {if empty($item['type'])}selected{/if}>默认</option>
                    <option value="1" {if $item['type'] == 1}selected{/if}>普通</option>
                    <option value="2" {if $item['type'] == 2}selected{/if}>高级</option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label">作者</label>
            <div class="col-sm-9 col-xs-12">
                <select class="form-control select2" name="author_id">
                    <option value="0" {if empty($item['author_id'])}selected{/if}>未选择</option>
                    <option value="1" {if $item['author_id'] == 1}selected{/if}>张三</option>
                    <option value="2" {if $item['author_id'] == 2}selected{/if}>李四</option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label">学历</label>
            <div class="col-sm-9 col-xs-12">
                <select class="form-control select2" name="education[]" multiple=''>
                    <option value="1" {if in_array(1,explode(",",$item['education']))}selected{/if}>小学</option>
                    <option value="2" {if in_array(2,explode(",",$item['education']))}selected{/if}>初中</option>
                    <option value="3" {if in_array(3,explode(",",$item['education']))}selected{/if}>高中</option>
                    <option value="4" {if in_array(4,explode(",",$item['education']))}selected{/if}>大学</option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label"></label>
            <div class="col-sm-9">
                <input type="hidden" name="backUrl" value="{:webUrl('form.basic/main')}">
                <input type="submit" class="btn btn-primary" value="保存">
                <a class="btn btn-default" href="{:webUrl('form.basic/main')}">返回列表</a>
            </div>
        </div>

    </form>
</div>


{/block}